<?php
declare (strict_types = 1);

namespace app\model;

use think\Model;


/**
 * Class app\model\Goods
 *
 * @property float $original_price 原价
 * @property int $class_id 分类
 * @property int $deletetime
 * @property int $id
 * @property int $sales 成交量
 * @property mixed $weight 重量
 * @property string $createtime
 * @property string $description 商品描述
 * @property string $images 图片
 * @property string $name 名称
 * @property string $videos 视频
 * @property-read \app\model\GoodsOrdersAssess[] $assess
 * @property-read \app\model\GoodsSpec[] $spec
 * @property-read \app\model\UserCollect $user_collect
 */
class Goods extends Model
{
	protected $createTime = 'createtime';
	
	function assess()
	{
		return $this->hasMany(GoodsOrdersAssess::class,'goods_id');
	}
	
	public function userCollect()
	{
		return $this->hasOne(UserCollect::class,'goods_id');
	}
	
	function spec()
	{
		return $this->hasMany(GoodsSpec::class,'goods_id');
	}
}
